<template>
  <div class="contact-info-form">
    <h3 class="section-title">联系方式</h3>
    <el-row :gutter="20">
      <el-col :span="8">
        <el-form-item label="手机号码" prop="phone" required>
          <el-input 
            v-model="formData.phone" 
            placeholder="请输入手机号码"
            clearable
          />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="电子邮箱" prop="email" required>
          <el-input 
            v-model="formData.email" 
            placeholder="请输入电子邮箱"
            clearable
          />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="微信号/WhatsApp" prop="wechat">
          <el-input 
            v-model="formData.wechat" 
            placeholder="请输入微信号或WhatsApp"
            clearable
          />
        </el-form-item>
      </el-col>
    </el-row>
    <div class="privacy-notice">
      <el-alert
        title="隐私保护"
        description="您的联系方式仅对平台管理员可见，企业端将无法查看您的联系方式信息。"
        type="info"
        :closable="false"
        show-icon
      />
    </div>
  </div>
</template>

<script>
export default {
  name: 'ContactInfoForm',
  props: {
    modelValue: {
      type: Object,
      default: () => ({
        phone: '',
        email: '',
        wechat: ''
      })
    }
  },
  emits: ['update:modelValue'],
  data() {
    return {
      formData: { ...this.modelValue }
    }
  },
  watch: {
    modelValue: {
      handler(newVal) {
        this.formData = { ...newVal }
      },
      deep: true
    },
    formData: {
      handler(newVal) {
        this.$emit('update:modelValue', newVal)
      },
      deep: true
    }
  }
}
</script>

<style scoped>
.contact-info-form {
  margin-bottom: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #409eff;
}

.privacy-notice {
  margin-top: 16px;
}
</style> 